Skip to content

Fix .save.postreplay default in dbwriteutils.q - #786

Merged
DanielPyper merged 1 commit into
masterfrom
Fix-postreplay-dbwriteutils
Nov 27, 2026
Merged

DanielPyper merged 1 commit into
masterfrom
Fix-postreplay-dbwriteutils

Conversation

@DanielPyper

Copy link
Copy Markdown
Contributor

Problem

The default for .save.postreplay is set with @[value;postreplay;{[d;p] }]. If no hook is configured, value fails and q passes the error message to the handler. The handler takes two arguments (d and p) but is only given one, so q returns a half-applied function instead of the no operation fucntion we want.

After EOD, calling .save.postreplay[d;p] on that half-applied function fails with 'rank.

Fix

Wrap the handler in a second pair of braces: {{[d;p] }}. The outer braces take the error message and ignore it. The inner function is returned as the default. rdb.q, wdb.q and tickerlogreplay.q already do it this way.

Testing

Started wdb1 in debug mode with no postreplay hook configured.

Before:

  • type .save.postreplay -> 104h
  • .save.postreplay[:.;2026.01.01]->'rank`
  • the stored value prints as {[d;p] }["postreplay"]

After:

  • type .save.postreplay -> 100h
  • .save.postreplay[:.;2026.01.01]` -> no error
  • the stored value prints as {[d;p] }

Notes

Only the default changes. A user-defined .save.postreplay set before the file loads is still kept.

@DanielPyper DanielPyper changed the title Fix Missing Second Brackets on .save.postreplay default in dbwriteutils.q Fix .save.postreplay default in dbwriteutils.q Nov 27, 2026
@DanielPyper
DanielPyper merged commit 629c933 into master Nov 27, 2026
jaen15marcos added a commit to jaen15marcos/TorQ that referenced this pull request Dec 1, 2026
dbwriteutils.q: .save.postreplay's default is master's line again. DataIntellectTech#786
fixed the same default on master with {{[d;p] }}; this branch had
{[e] {[d;p] }}, which does the same. Using master's line leaves
dbwriteutils.q unchanged by this branch.

rdb.q: restoretimeout restores the timeout only where timeoutreset has
saved one. timeoutreset runs from a timer one minute before the
scheduled roll, so an end of day which that timer did not prepare (one
forced on the tickerplant) stopped the RDB's reload on an undefined
.rdb.timeout, and the RDB kept the day's rows.

tests/schemas/run.sh: the suite stops its processes and starts them
again straight away, and torq.sh start skips a process that is still
running. A tickerplant that took a moment to exit was therefore missing
for the second half of the suite, and its five tickerplant checks
failed. run.sh now waits, ten seconds at most, until the processes have
stopped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants